do while PIL6<>1 .and. pil5<>2 .AND. LASTKEY()<>27
   SET COLOR TO BG+/B
   @ 15,1 CLEA TO 23,78
   do BOX2 WITH 15,3,"DO YOU WANT TO :",'PRINT','QUIT','GR+','RB','GR+','R',PIL5,.T.,.T.
   IF PIL5=1
      do BOX2 WITH 20,3,"IS THE PRINTER :",'READY','NOT YET READY','GR+','RB','GR+','R',PIL6,.T.,.T.
   ENDIF
ENDDO
IF LASTKEY()=27 .or. pil5=2
   RETURN
ENDIF
DO BOXT WITH 15,53,'Printing...','GR*+','R',.T.,.T.
do preprtfm
SELE 3
SET EXCLU OFF
USE &DR&F3
IF FIL_LOCK()
   APPEND BLANK
ENDIF
IF REC_LOCK()
   DO PATR20
ENDIF
UNLOCK
SET DEVI TO SCREEN
SET COLO TO BG+/B,W+/N
@ 7,1 CLEA TO 23,78
PRPAT=.T.
RETURN

Procedure Preprtfm
*-----------------
SET DEVICE TO PRINTER
@ 4, 60 SAY DATE()
@ 6, 13 SAY PNAME
@ 6, 40 SAY PFNAME
@ 6, 72 SAY MINIT
@ 8, 13 SAY PATDOB
** Dickson -Start - 29/6/2001 - if nationality is UNKNOWN then don't print it out
IF ALLTRIM(PATNAT) <> "UNKNOWN"
 @ 8, 40 SAY PATNAT
ENDIF
** Dickson -End
**@ 8, 40 SAY PATNAT

@ 8, 72 SAY PATSEX
@ 10, 13 SAY GRP
@ 10, 28 SAY RHE
@ 10, 71 SAY kodepat
EJECT
SET DEVICE TO SCREEN

